Ternary 三元運算子


Posted by Rich on 2021-04-22

console.log(10 > 5 ? 'bigger' : 'smaller')
output:bigger

condition ? true : false
條件 ? true就執行 : false就執行


#note







Related Posts

數學證明(Mathematical Proofs)

數學證明(Mathematical Proofs)

【JS上課筆記】JavaScript 的非同步請求:AJAX、Fetch API

【JS上課筆記】JavaScript 的非同步請求:AJAX、Fetch API

To Infinity and Beyond - Regression Kink Design

To Infinity and Beyond - Regression Kink Design


Comments